Skip to content

feat(arrivals): ask about new menu bar apps from the arrow - #503

Merged
tieubao merged 2 commits into
developfrom
feat/arrivals-inbox
Nov 15, 2026
Merged

tieubao merged 2 commits into
developfrom
feat/arrivals-inbox

Conversation

@tieubao

@tieubao tieubao commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

F2 Arrivals inbox (macOS 27, direct build, native engine). Settings, Icons gets a popup "When an app adds a new icon": Ask Me, Show It, Hide It (newAppDefaultSection, 0 ask / 1 show / 2 hide).

  • Show It (default, the 1.12 behavior) and Hide It place a never-seen app in that section on first sight through PinnedSectionEdits.set, and never ask.
  • Ask Me keeps the app visible, queues it under arrivalsPending, puts a dot on the arrow, and asks once from a popover under the arrow ("New in your menu bar", Show / Hide, an ellipsis with Always hide). An answer writes the section and clears the entry. Waiting apps sit first in the Icons list with a NEW tag.
  • Decision logic (seen set via the catalog, pending queue, answer application, upgrade seeding, 24 hour lapse) is the pure ArrivalsInbox.
  • Debug hooks: arrivals-inject <bundle>, arrivals-answer <bundle>=show|hide|always-hide, arrivals-prompt (opens the prompt as an arrow click does). dump-state gains arrivalsPending, newAppDefaultSection, arrivalsPromptShown, arrivalsDot.

Why

Pinned sections stopped the drift, but a new app still lands wherever macOS puts it. Asking once per app, and remembering the answer, is the opt-in rule: with defaults, 1.13 behaves like 1.12.

Decisions

  • Default is Show It, not the board's Ask Me (lead decision: opt-in rule wins).
  • An app is asked at most once, across restarts: the catalog persists first-seen times, so an arrival happens once ever; the controller also handles each bundle once per run, because the catalog republishes the latest read's arrivals on every later change and a repeat must not undo an answer or the user's own edit.
  • Ask Me also writes visible for an arrival the table had on the hidden side (macOS puts a new icon far left), so "stays shown" is true. Show It writes visible the same way; PinnedSectionResolver.newAppSection is untouched.
  • Pinned sections off: nothing is placed or asked (the table is not applied). The popup stays, disabled. Arrivals during that time are not held for later.
  • The prompt opens on the arrow click that expands the bar while something waits; closing it unanswered leaves the dot and the question. Answering the last one closes it. Auto-collapse is deferred while it is open.
  • Unanswered after 24 hours (board risk row): the question lapses and the Settings default applies (Ask Me leaves the app shown). The age comes from the catalog's first-seen time, so arrivalsPending stays a plain array of bundle ids.
  • Icon count for "Added 2 icons. They show or hide together." is counted from the engine's raw read (two lines in MenuBarEngineFactory's read closure); it is not persisted.
  • Always hide ("..." menu) is an answer too (alwaysHidden).
  • No notification-center banner, no new permission or entitlement.

Not built (board states with no production source)

  • The dot under the new app's own icon (Arrivals-Entry): it needs an overlay window over another app's status item; the arrow dot and the NEW tag carry the signal.
  • "A macOS item appears" and "Relaunch or update (Kept)" are drawn (snapshots, view styles .notice and .kept) but nothing raises them: the catalog excludes macOS extras by design, and a known app is simply never asked. Wiring needs system item arrivals from the inventory (Live Activities are unmapped on 27.3).
  • Engine unavailable: no Icons tab exists then (App Store build, macOS 26 and earlier, the pane is registered only for the native engine), so there is no row to render.

Tests

Scheme Passed Failed Baseline (develop a6e2400)
Direct, scripts/test.sh --scheme direct --no-parallel-testing 473 0 428
App Store 314 0 293

New: HiddenBarTests/ArrivalsInboxTests (21, both schemes), HiddenTests/ArrivalsControllerTests (14) and ArrivalsPromptTests (6) plus 4 in SettingsWindowTests. Pref key lists updated per the contract: newAppDefaultSection in legacyOtherKeys, the App Store hidden-rows list, AppStoreSettingsImport.importableKeys and the test's appKeys; arrivalsPending is internal (in neither). One existing test now ignores the new popup when it checks the controls column.

With parallel testing on, direct runs end with "test runner exited with code 0 before establishing connection" errors (8 here, 5 on untouched develop on this Mini); serial and the full result above are clean. Re-run on CI if it shows up.

Negative control

Committed first, then one mutation at a time on production code, scripts/test.sh --scheme direct --no-parallel-testing, each exit 1, file restored with git checkout:

Mutation Failing tests
Ask Me does not queue 9, among them test_askMe_queuesAndKeepsTheAppShown, test_askMe_keepsTheAppShownAndQueuesIt
Each arrival handled again (no once-per-run guard) test_aRepublishedArrivalNeverReAsks, test_aRepeatedArrivalDoesNotUndoTheUsersEdit, test_anAnsweredAppIsNotAskedAgainInTheSameRun
Answer leaves the entry queued test_answer_clearsTheEntryAndReturnsTheSection, test_answer_writesTheSectionAndClearsTheEntry, test_anAppIsAskedAtMostOnce_acrossARestart (+2)
Hide It places visible test_hideIt_placesHiddenAndAsksNothing, test_hideIt_placesHiddenAndNeverAsks, test_newAppDefaultStorage (+2)
Questions never lapse test_aQuestionLapsesAfterADay, test_aLapsedQuestionTakesTheSettingsDefault
Popup writes nothing test_menuBarApps_newAppPopupWritesItsKey
Waiting apps not first test_menuBarApps_undecidedAppsSitFirstWithANewTag
Key out of the import whitelist testWhitelistCoversEveryPreferenceKeyTheAppDefines
Removed apps keep their question test_removingAnAppFromTheListDropsItsQuestion

The new logic tests also fail on develop: ArrivalsInbox, NewAppDefault and UserDefaultsArrivalsPending do not exist there.

Snapshots (offscreen, -settingsSnapshotDir, light and dark)

Local folder ~/.cache/hidden-bar/snap-arrivals-final/, each as direct-arrivals-<state>-<light|dark>.png, compared by eye with the boards:

  • entry: menu bar with the dotted arrow (Arrivals-Entry; the dot under the app's icon is not built)
  • prompt: Raycast and Tailscale (Arrivals-Light, Arrivals-Dark)
  • edge-multi-icon: Docker Desktop, 2 icons (Arrivals-Edge)
  • edge-many: 6 new apps, "and 3 more", Hide All / Show All (Arrivals-Edge)
  • edge-known: Slack, Kept (Arrivals-Edge)
  • edge-system: Timer, OK (Arrivals-Edge)
  • edge-not-running: an app that quit before an answer ("Not running now. It stays shown until you choose.")
  • direct-menubarapps-new-<light|dark>.png: Icons with Ask Me and two NEW rows (Arrivals-Settings); direct-menubarapps-off-* shows the popup disabled with Pinned sections off

Differences from the boards: the popover is drawn without the system material (flat fill in the offscreen scene), 360 pt wide for all states, and the NEW row tint is flat accent 10 percent.

Notes for the lead

  • StatusBarController: one stored property block (#if native), one startArrivals() call in init, a 2 line change in the .toggle case, one term in defersCollapseApartFromPointer, three debug cases, and a separate //MARK: - Arrivals extension at the end of the file. NativeVisibilityEngine is not touched; MenuBarEngineFactory gains one line in the read closure.
  • New group Arrivals was added to the pbxproj by hand (the tool cannot create groups); files registered with pbxproj-add.
  • CHANGELOG and the ROADMAP box are left for the release batch.

Settings, Icons: "When an app adds a new icon" with Ask Me, Show It (default,
the 1.12 behavior) and Hide It, stored as newAppDefaultSection. Show It and Hide
It place a never-seen app through PinnedSectionEdits.set on first sight. Ask Me
keeps it visible, queues it under arrivalsPending, dots the arrow and asks once
from a popover under the arrow; an answer writes the section. Waiting apps sit
first in the Icons list with a NEW tag. Decision logic is the pure ArrivalsInbox.
Debug hooks arrivals-inject, arrivals-answer, arrivals-prompt.
Show It now returns no placements, so the engine's resolver places a never-seen
app as in 1.12 and pinned entries the catalog never saw (App Store imports) are
left alone. The new-app caption describes the selected option.
@tieubao
tieubao merged commit c195025 into develop Nov 15, 2026
3 checks passed
@tieubao
tieubao deleted the feat/arrivals-inbox branch November 16, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant